package com.example.demo.entity;

import javax.persistence.Entity;
import javax.persistence.ManyToOne;
import javax.persistence.Transient;

import com.example.demo.custom.BaseEntity;

/**
 * 职位表
 * @author 吕佳辉
 *
 */
@Entity
public class Position extends BaseEntity<Integer>{
	private String name;//岗位名称
	private SysDept dept;//所属部门
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	
	@ManyToOne
	public SysDept getDept() {
		return dept;
	}
	public void setDept(SysDept dept) {
		this.dept = dept;
	}
	
	@Transient
	public String getDeptName() {
		
		return dept==null?"":dept.getName();
	}
	@Transient
	public Integer getDeptNameId() {
		
		return dept==null?null:dept.getId();
	}
	
}
